<?php /* Smarty version 2.6.18, created on 2010-03-09 21:03:10
         compiled from edittankinspection.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'edittankinspection.tpl', 56, false),)), $this); ?>
<script type="text/javascript">	
	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[date_inspected]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_inspected",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });		
	    Calendar.setup({
	        inputField     :    "cal[date_next_inspection]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_next_inspection",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });				    
	'; ?>

</script>
<form name="mainForm" method="POST" id="mainForm">
<input type="hidden" name="user[tank_inspection_id]" value="<?php echo $this->_tpl_vars['id']; ?>
">	
	<h1>Tank Inspection</h1>
	<div class="blue">
		<table width="100%">
			<tr>
				<td>Select System:</td>
				<td><select name="user[system]">
					<option value="">--Select--</option>
				<?php $_from = $this->_tpl_vars['orgSystems']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['system']):
?>
					<option value="<?php echo $this->_tpl_vars['system']['system_name']; ?>
" <?php if ($this->_tpl_vars['tank_system'] == $this->_tpl_vars['system']['system_name']): ?> selected <?php endif; ?>><?php echo $this->_tpl_vars['system']['system_name']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>
				</select></td>
			</tr>			
			<tr>
				<td>Select Tank:</td>
				<td><select name="user[tank]">
					<option value="">--Select--</option>
				<?php $_from = $this->_tpl_vars['orgTanks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['tank']):
?>
					<option value="<?php echo $this->_tpl_vars['tank']['tank_id']; ?>
" <?php if ($this->_tpl_vars['inspection']['tank_id'] == $this->_tpl_vars['tank']['tank_id']): ?> selected <?php endif; ?>><?php echo $this->_tpl_vars['tank']['name']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>
				</select></td>
			</tr>
			<tr>
				<td>Inspection Date:</td>
				<!-- <td><input style="text-align: right" type="text" name="user[date_inspected]" value="<?php echo $this->_tpl_vars['inspection']['date_inspected']; ?>
" size="10"></td> -->
				<td>
					<input style="float:left" type="hidden" name="user[date_inspected]" id="cal[date_inspected]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['inspection']['date_inspected'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
					<span id="date_inspected"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['inspection']['date_inspected'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
					<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"/>
					<input type="hidden" name="dateYui" value="cal[date_inspected]/date_inspected/f_trigger_c1">
				</td>			
			</tr>
			<tr>
				<td valign="top">Remarks:</td>
				<td><input type="text" name="user[remarks]" value="<?php echo $this->_tpl_vars['inspection']['remarks']; ?>
" size="100"></td>
			</tr>
			<tr>
				<td>Result:</td>
				<td><select name="user[result]">
					<option value="" <?php if ($this->_tpl_vars['inspection']['result'] == ''): ?> selected <?php endif; ?>>--Select--</option>
					<option value="Passed" <?php if ($this->_tpl_vars['inspection']['result'] == 'Passed'): ?> selected <?php endif; ?>>Passed</option>
					<option value="Failed" <?php if ($this->_tpl_vars['inspection']['result'] == 'Failed'): ?> selected <?php endif; ?>>Failed</option>
				</select></td>
			</tr>
			<tr>
				<td>Next Inspection:</td>
				<!-- <td><input style="text-align: right" type="text" name="user[date_next_inspection]" value="<?php echo $this->_tpl_vars['inspection']['date_next_inspection']; ?>
" size="10"></td> -->
				<td>
					<input style="float:left" type="hidden" name="user[date_next_inspection]" id="cal[date_next_inspection]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['inspection']['date_next_inspection'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
					<span id="date_next_inspection"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['inspection']['date_next_inspection'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
					<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c2" style="cursor: pointer; border: 0px ;" title="Date selector"/>
					<input type="hidden" name="dateYui" value="cal[date_next_inspection]/date_next_inspection/f_trigger_c2">
				</td>				
			</tr>
			
		</table>
	</div>


	<div id="result">
		<div>
			<table border="0" style="width: 100%">
				<tr>
					<div>
						<table border="0" width="100%">
							<tr><td  style="width: 100px; padding-top: 20px" colspan ="3"></td></tr>
							<tr><td colspan="3"><hr></td></tr>
							<tr>
								<td width="20%">Item</td>
								<td width="150px" align-="right">Units</td>
								<td width="70%">Remarks</td>
							</tr>
							<tr><td colspan="3"><hr></td></tr>
							<tr>
								<td>Calcium</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[calcium]" value="<?php echo $this->_tpl_vars['inspection']['calcium']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[calcium_remarks]" value="<?php echo $this->_tpl_vars['inspection']['calcium_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>KH</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[kh]" value="<?php echo $this->_tpl_vars['inspection']['kh']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[kh_remarks]" value="<?php echo $this->_tpl_vars['inspection']['kh_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Ammonia</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[ammonia]" value="<?php echo $this->_tpl_vars['inspection']['ammonia']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[ammonia_remarks]" value="<?php echo $this->_tpl_vars['inspection']['ammonia_remarks']; ?>
" size="100"></td>
							</tr>	
							<tr>
								<td>Nitrite</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[nitrite]" value="<?php echo $this->_tpl_vars['inspection']['nitrite']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[nitrite_remarks]" value="<?php echo $this->_tpl_vars['inspection']['nitrite_remarks']; ?>
" size="100"></td>
							</tr>	
							<tr>
								<td>Re-Dox</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[redox]" value="<?php echo $this->_tpl_vars['inspection']['redox']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[redox_remarks]" value="<?php echo $this->_tpl_vars['inspection']['redox_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Nitrate</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[nitrate]" value="<?php echo $this->_tpl_vars['inspection']['nitrate']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[nitrate_remarks]" value="<?php echo $this->_tpl_vars['inspection']['nitrate_remarks']; ?>
" size="100"></td>
							</tr>							
							<tr>
								<td>Salinity</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[salinity]" value="<?php echo $this->_tpl_vars['inspection']['salinity']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[salinity_remarks]" value="<?php echo $this->_tpl_vars['inspection']['salinity_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Temperature</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[temperature]" value="<?php echo $this->_tpl_vars['inspection']['temperature']; ?>
" size="6">&nbsp;&deg;c</td>
								<td><input align="right" type="text" name="user[temperature_remarks]" value="<?php echo $this->_tpl_vars['inspection']['temperature_remarks']; ?>
" size="100"></td>
							</tr>
						<!-- </table>
						<table border="0" width="100%">
							<tr><td  style="width: 100px; padding-top: 20px" colspan ="3"></td></tr>
							<tr bgcolor="#cccccc">
								<td width="20%">Item</td>
								<td width="150px" align-="right">Units</td>
								<td width="70%">Remarks</td>
							</tr>  -->
							<tr><td colspan="3" style="width: 100px; padding-top: 20px">&nbsp;</td></tr>
							<tr>
								<td>Additives Replenishment</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[additives]" value="<?php echo $this->_tpl_vars['inspection']['additives']; ?>
" size="6"></td>
								<td><input align="right" type="text" name="user[additives_remarks]" value="<?php echo $this->_tpl_vars['inspection']['additives_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Light Bulb Change</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[bulb_change]" value="<?php echo $this->_tpl_vars['inspection']['bulb_change']; ?>
" size="6">&nbsp;&nbsp;bulb(s)</td>
								<td><input align="right" type="text" name="user[bulb_change_remarks]" value="<?php echo $this->_tpl_vars['inspection']['bulb_change_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Pump Cleaning</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[pump_cleaning]" value="<?php echo $this->_tpl_vars['inspection']['pump_cleaning']; ?>
" size="6">&nbsp;&nbsp;pump(s)</td>
								<td><input align="right" type="text" name="user[pump_cleaning_remarks]" value="<?php echo $this->_tpl_vars['inspection']['pump_cleaning_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>UV Replacement</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[uv_replacement]" value="<?php echo $this->_tpl_vars['inspection']['uv_replacement']; ?>
" size="6">&nbsp;&nbsp;bulb(s)</td>
								<td><input align="right" type="text" name="user[uv_replacement_remarks]" value="<?php echo $this->_tpl_vars['inspection']['uv_replacement_remarks']; ?>
" size="100"></td>
							</tr>
							<tr>
								<td>Water Change</td>
								<td nowrap ="1"><input style="text-align: right" type="text" name="user[water_change]" value="<?php echo $this->_tpl_vars['inspection']['water_change']; ?>
" size="6">&nbsp;&nbsp;gallon(s)</td>
								<td><input align="right" type="text" name="user[water_change_remarks]" value="<?php echo $this->_tpl_vars['inspection']['water_change_remarks']; ?>
" size="100"></td>
							</tr>
						</table>
					</div>
				</tr>
				<table style="width:100%">
					<tr><td  style="width: 100px; padding-top: 20px" colspan ="3">&nbsp;<hr></td></tr>
					<tr>
						<td align="right">
							<input type="button" <?php if ($this->_tpl_vars['inspection']['tank_inspection_id'] == 0): ?> value="Create" <?php else: ?> value="Save" <?php endif; ?> onclick="doajaxAction('/account/saveTankInspection',1,'mainForm',document.getElementById('mainForm'),'True')">
							<input type="button" value="Cancel" onclick="cancel();">					
						</td>
					</tr>
				</table>
			</table>
		</div>
    </div><!-- results -->

<!--				<tr align="right">
					<td colspan="3" nowrap="1">
						<?php if ($this->_tpl_vars['inspection']['tank_inspection_id'] > 0): ?>
							<input type="button" value="Show Inspection" onclick="submitForm('mainForm','/account/tankInspectionResult/inspectionId/<?php echo $this->_tpl_vars['inspection']['tank_inspection_id']; ?>
')">
						<?php endif; ?>&nbsp;&nbsp;
						<input type="button" <?php if ($this->_tpl_vars['inspection']['tank_inspection_id'] == 0): ?> value="Create" <?php else: ?> value="Save" <?php endif; ?> onclick="doajaxAction('/account/saveTankInspection',1,'mainForm',document.getElementById('mainForm'),'True')">
						<input type="button" <?php if ($this->_tpl_vars['inspection']['tank_inspection_id'] == 0): ?> value="Create" <?php else: ?> value="Save" <?php endif; ?> onclick="alert('');submitForm('mainForm','/account/saveTankInspection');alert('her');"> 
						<input type="button" value="Cancel" onclick="cancel();">
					</td>
				</tr> -->



</form>
<script language="javascript">
<?php echo '
	function cancel(){
		doajaxAction("/account/tankInspection",0,"main_content");
	}
	function save(key){
		doajaxAction("/account/saveTankInspection/redirect/"+key,1,"mainForm",document.getElementById(\'mainForm\'),"True");
	}
'; ?>

</script>
            
            